/*
 * TeacherIterator.cpp
 *
 *  Created on: 13 May 2010
 *      Author: Savramis Sartios
 */

#include "TeacherIterator.h"

TeacherIterator::TeacherIterator() {
	throw;
}

TeacherIterator::~TeacherIterator() {
}

TeacherIterator::TeacherIterator(const ITeacherList *teachers){
	if(0!=teachers){
		setTeachers(teachers);
		current_=0;
	}
}

bool		TeacherIterator::first(){
	if(initIterator()){
		current_=0;
		return true;
	}
	throw;
}

bool		TeacherIterator::next(){
	if(increaseCurrent()){
		it_++;
		return true;
	}
	throw;
}

bool		TeacherIterator::isDone(){
	return	current_>=teachers_->count();
}

ITeacher *	TeacherIterator::getTeacher(){
	return	*it_;
}

string	 *	TeacherIterator::getTeacherCode(const string *name,const string *lastName){

}

string	 *	TeacherIterator::getTeacherName(const string *code){

}

string	 *	TeacherIterator::getTeacherLastName(const string *code){

}

bool	TeacherIterator::increaseCurrent(){
	current_++;
	return true;
}

bool	TeacherIterator::setCurrent(const int *current){
	if(0!=current){
		if(*current<teachers_->count()){
			current_=*current;
			return true;
		}
		throw;
	}
	throw;
}

bool	TeacherIterator::initIterator(){
	it_=teachers_->getBegin();
	if(it_==teachers_->getEnd()){
		throw;
	}
	return true;
}

int TeacherIterator::getCurrent(){
	return current_;
}

bool	TeacherIterator::setTeachers(const ITeacherList *teachers){
	if(0!=teachers){
		teachers_=const_cast<ITeacherList *>(teachers);
		return true;
	}
	throw;
}
